class Solution
{
public:
    vector<int> findingUsersActiveMinutes(vector<vector<int>> &logs, int k)
    {
        unordered_map<int, unordered_set<int>> userActives;
        for (auto &log : logs)
        {
            userActives[log[0]].insert(log[1]);
        }
        vector<int> answer(k);
        for (auto &[user, active] : userActives)
        {
            if (active.size() >= 1 && active.size() <= k)
            {
                ++answer[active.size() - 1];
            }
        }
        return answer;
    }
};